#ifndef SETTINGS_H
#define SETTINGS_H

#include <QtGui/QApplication>
#include <QtCore/QSettings>

class Settings : public QSettings
{
    Q_OBJECT

    public:
        explicit Settings(QObject *parent = 0) : QSettings(QSettings::IniFormat,
                                                           QSettings::UserScope,
                                                           QCoreApplication::instance()->organizationName(),
                                                           QCoreApplication::instance()->applicationName(),
                                                           parent) {}

        Q_INVOKABLE inline void setValue(const QString &key, const QVariant &value) { QSettings::setValue(key, value); QSettings::sync(); }
        Q_INVOKABLE inline QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const { return QSettings::value(key, defaultValue); }
};

#endif // SETTINGS_H
